package com.example.shortmessage.presenter;

import android.content.Context;

import com.example.shortmessage.contract.MainContract;
import com.example.shortmessage.dao.ObtainShortMessage;
import com.example.shortmessage.data.entity.MessageData;
import com.example.shortmessage.model.MainModel;

import java.util.List;

public class MainPresenter extends MainContract.Presenter<MainContract.View> {

    private final MainModel model;
    private final Context context;

    public MainPresenter(Context context) {
        this.context = context;
        model = new MainModel();
    }

    @Override
    public void release() {

    }

    @Override
    public void upData() {
        ObtainShortMessage.obtainShortMessage(context);
    }

    @Override
    public List<MessageData> loadData(String read) {
        List<MessageData> choose = model.choose(read);
        return choose;
    }

}
